// 目标：提供封装了执行据角色操作相关功能的异步请求 api方法
// 导入 axios
import axios from "@/utils/requset.js"
// 按需导出api方法
export const getRoles = () =>
  axios({
    url: 'roles',
    method:'get'
  })

  // 删除角色指定权限
export const delRoles = (roleId, rightId) => axios({
  url: `roles/${roleId}/rights/${rightId}`,
  method: 'delete',
})

// 角色授权
export const postId = (roleId, rids) => axios({
  url: `roles/${roleId}/rights`,
  method: 'post',
  data: { rids }
})